Skip to content

(PlayerMethods): Taxi Node Improvements#357

Merged
iThorgrim merged 3 commits intoazerothcore:masterfrom
Aldori15:taxi-node-improvements
Feb 13, 2026
Merged

(PlayerMethods): Taxi Node Improvements#357
iThorgrim merged 3 commits intoazerothcore:masterfrom
Aldori15:taxi-node-improvements

Conversation

@Aldori15
Copy link

@Aldori15 Aldori15 commented Feb 6, 2026

  • GetKnownTaxiNodes() method should use an index counter instead of lua_rawlen. This is better than using lua_rawlen every time since it can become expensive if the nodes list is very large. This method was originally added by me in commit bcfe631

  • Add a new method called HasKnownTaxiNode() to PlayerMethods. This method simply returns true if the Player knows the nodeId or returns false otherwise.

  • GetKnownTaxiNodes() is used to return a table/list of all known taxi nodes by the Player. HasKnownTaxiNode() is used to simply check if a certain nodeId is known by the player, similarly to checks like HasSpell(), HasSkill(), etc. Both of these methods are actively used by the Accountwide Taxi Paths script on my Github repo.

image image

…tead of lua_rawlen

Using an index counter is more performant than using lua_rawlen every time since lua_rawlen can become expensive if the nodes list is very large.
Add HasKnownTaxiNode to PlayerMethods.  This method will return `true` if the Player knows the given nodeId, `false` otherwise.

This method is used in my Accountwide Taxi Paths script on my Github.
Aldori15 added a commit to Aldori15/azerothcore-eluna-accountwide that referenced this pull request Feb 9, 2026
This is a major overhaul of the entire accountwide system that I have been working on for the last week.  It fixes a couple of bugs, but mostly caching optimizations for reduced DB read/writes with less lookups and just performance overall.

Couple of notes:
- As always, if you are doing a fresh install - just copy over the scripts and run the SQL file.  If you are updating over an existing installation, copy & replace the old Lua files and also run the SQL file again.  There was a new DB table added for the Reputation script, so you will need to run the SQL file.

- If you use the AccountTaxiPaths script, you will need to update to my latest mod-ale fork as it contains an implementation for HasKnownTaxiNode: Aldori15/mod-ale@2fdd482. This method currently does NOT exist in Azerothcore's mod-ale repo.  I submitted a Pull Request to the Azerothcore repo, so until that is approved/merged, you will need to use my fork or cherry pick the commit referenced above.  azerothcore/mod-ale#357

I did thorough testing of all scripts but I am just one person.  So if you encounter any issues, please open up a Bug/Issue or message me on discord @aldori
@iThorgrim iThorgrim requested a review from Copilot February 12, 2026 05:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes the Lua Player:GetKnownTaxiNodes() implementation and adds a new Lua API Player:HasKnownTaxiNode(nodeId) to check whether a specific taxi node is known, supporting scripts that need fast per-node lookups.

Changes:

  • Updated GetKnownTaxiNodes() to use an incrementing index instead of repeatedly calling lua_rawlen.
  • Added Player:HasKnownTaxiNode(nodeId) and registered it in the Lua Player method table.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/LuaEngine/methods/PlayerMethods.h Optimizes taxi node list construction and introduces HasKnownTaxiNode() implementation.
src/LuaEngine/LuaFunctions.cpp Registers the new HasKnownTaxiNode Player method for Lua exposure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

After Copilot review:
- Use an unsigned cast for the shift instead of a signed int.

- Make the early return !player case properly return a boolean value.
@Aldori15
Copy link
Author

Copilot review complete and resolved.

@iThorgrim iThorgrim self-requested a review February 13, 2026 08:38
@iThorgrim iThorgrim merged commit fe47a5d into azerothcore:master Feb 13, 2026
5 checks passed
@Aldori15 Aldori15 deleted the taxi-node-improvements branch February 13, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants